-
Notifications
You must be signed in to change notification settings - Fork 8k
ARM64 FVP Board Unification and ARMv9-A Support #96852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
e17a152
to
4c67c12
Compare
79a135e
to
1570dec
Compare
|
||
config SOC_FVP_BASE_REVC_2XAEMV8A | ||
config SOC_FVP_V8A | ||
bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool |
Board Variants | ||
============== | ||
|
||
This board configuration supports multiple architecture variants: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This board configuration supports multiple architecture variants: | |
The following board targets are available: |
or other reword to remove configuration
The legacy board name ``fvp_base_revc_2xaemv8a`` has been replaced with the | ||
unified ``fvp_base_revc_2xaem/v8a`` naming. Update your build commands: | ||
|
||
* Old: ``west build -b fvp_base_revc_2xaemv8a`` | ||
* New: ``west build -b fvp_base_revc_2xaem/v8a`` | ||
|
||
The legacy board name remains supported for backward compatibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a no, use the deprecated board feature
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config BOARD_FVP_BASE_REVC_2XAEM | ||
bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool |
NEVER declare these auto generated symbols, same goes for all below
bool | ||
default y if BOARD_QUALIFIERS = "a320" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no on this
|
||
**Cortex-A320 Configuration:** | ||
|
||
The ``a320`` variant provides Cortex-A320 specific FVP configuration with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use full name and call board target
# Use cortex-a710 as fallback since both are high-performance ARMv9-A cores with similar features | ||
# TODO: Update to use cortex-a320 when GCC support is added (likely in GCC 15 or 16) | ||
set(GCC_M_CPU cortex-a710) | ||
message(STATUS "Using cortex-a710 as fallback for cortex-a320 (not yet supported in GCC)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drivers/pm_cpu_ops/Kconfig
Outdated
|
||
config PM_CPU_OPS_FVP | ||
bool "Support for ARM FVP CPU power management" | ||
depends on BOARD_FVP_BASE_REVC_2XAEMV8A && !PM_CPU_OPS_PSCI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drivers should not depend on boards, use proper DT_* or select it from a Kconfig
file in the board
/* Read the status for the selected CPU */ | ||
return sys_read32(pwrc_vaddr + PWRC_PSYSR_OFF); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a query not a change request: what do you think about moving boards to a separate |
Hi, it would be nice to have a maintainer for the ARM64 arch, this is now vacant :(
I could step in ... however I have yet more patches to submit and
without other people to review them this remains a problem.
|
7e162a1
to
5df7a66
Compare
Change SGI interrupt lines from 14-15 to 6-7 for nested interrupt testing. SGI 8-15 are unaccessible from Non-Secure state (e.g., when running with TF-A), causing test failures. SGI 0-2 are reserved for Zephyr SMP IPIs, so use SGI 6-7 which work in both Secure and Non-Secure configurations. Fixes test failure: "isr0 did not execute" assertion at line 184. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Add a new PM CPU ops driver for ARM Fixed Virtual Platform (FVP) that enables bare metal SMP support without ARM Trusted Firmware (ATF). The driver provides CPU power-on and system reset operations by directly interfacing with FVP's power controller (PWRC) and V2M system registers. The implementation includes RVBAR_EL3 configuration to redirect secondary CPU reset vectors to Zephyr's image header, enabling proper SMP initialization without firmware assistance. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This adds necessary configuration files to build with SMP and no trusted firmware. Given PSCI is not available, CPU power management uses the FVP power controller directly. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Reorganize fvp_aemv8a SOC into unified fvp_aem series with a v8a architecture variants to enable cleaner board target naming. This also sets the stage for upcoming ARMv9-A support. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Create unified board configuration to replace verbose board naming with shorter hierarchical structure. This board works with the new unified fvp_aem SOC series and supports the v8a architecture variant. This enables board targets like: - fvp_base_revc_2xaem/v8a (basic ARMv8-A) - fvp_base_revc_2xaem/v8a/smp (ARMv8-A SMP) - fvp_base_revc_2xaem/v8a/smp/ns (ARMv8-A SMP non-secure) The structure replaces the existing overly verbose board with a cleaner, more maintainable organization and provides a foundation for adding v9a variants. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Add deprecated.cmake mappings to redirect old board names to new unified structure: - fvp_base_revc_2xaemv8a → fvp_base_revc_2xaem/v8a - fvp_base_revc_2xaemv8a/fvp_base_revc_2xaemv8a/smp → fvp_base_revc_2xaem/v8a/smp - fvp_base_revc_2xaemv8a/fvp_base_revc_2xaemv8a/smp/ns → fvp_base_revc_2xaem/v8a/smp/ns This ensures existing build commands and documentation continue to work with deprecation warnings while transitioning to the new board structure. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Add ARMv9-A architecture support with Cortex-A510 CPU as the default processor for generic ARMv9-A targets. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
ARMv9-A is AArch64-only and does not support AArch32 execution states at EL1/EL2/EL3. Configure TF-A build to disable AArch32 register context (CTX_INCLUDE_AARCH32_REGS=0) when building for ARMv9-A platforms. This fixes TF-A boot failures on ARMv9-A non-secure variants where TF-A would panic with: ERROR: EL1 supports AArch64-only. Please set build flag CTX_INCLUDE_AARCH32_REGS = 0 Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
New board targets: - fvp_base_revc_2xaem/v9a (basic ARMv9-A single core) - fvp_base_revc_2xaem/v9a/smp (ARMv9-A SMP 4 cores) - fvp_base_revc_2xaem/v9a/smp/ns (ARMv9-A SMP non-secure with TFA) Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Add Cortex-A320 support to the unified FVP board structure with ARMv9.2-A specific configuration parameters. New board target: - fvp_base_revc_2xaem/a320 Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Add comprehensive test to validate ARM64 architectural feature detection across ARMv8.1 through ARMv9-A implementations, providing runtime verification of processor capabilities and security features. Core architecture features tested: - Exception Level (EL) support detection (EL0-EL3) - SVE (Scalable Vector Extension) presence and capabilities - Advanced SIMD (NEON) and Floating Point implementation levels - Architecture version classification (ARMv8 vs ARMv9-A) ARMv8.1-A+ features: - LSE (Large System Extensions) atomic operations with level detection - Pointer Authentication (PAC) with comprehensive variant analysis: * API/APA (Address), GPI/GPA (Generic) authentication * Enhanced PAC levels (1, 3, 4, 5) with FPACCOMBINE detection * QARMA3 algorithm support (GPA3/APA3) ARMv8.5-A+ security and performance features: - Branch Target Identification (BTI) for control flow integrity - Memory Tagging Extensions (MTE) with level classification - Random Number Generation (RNDR) hardware entropy - Speculative Store Bypass Safe (SSBS) side-channel mitigation ARMv8.7-A+ advanced features: - WFxT (Wait with Timeout) enhanced synchronization - RPRES (Reciprocal Precision) optimized math operations ARMv8.8-A+ features: - MOPS (Memory Copy/Set) optimized memory operations - BC (Branch Consistency) advanced branch handling Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Implement Scalable Vector Extension (SVE) context switching support, enabling threads to use SVE instructions with lazy context preservation across task switches. The implementation is incremental: if only FPU instructions are used then only the NEON access is granted and preserved to minimize context switching overhead. If SVE is used then the NEON context is upgraded to SVE and then full SVE access is granted and preserved from that point onwards. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Add test to validate SVE (Scalable Vector Extension) context switching implementation, ensuring proper register preservation across thread switches in multi-threaded environments. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Expand the SVE context switching test to cover all thread privilege combinations with validation of SVE state preservation across different contexts. Test Coverage: - Privileged vs Privileged threads (kernel mode) - User vs User threads (userspace with memory domains) - User vs Privileged threads (mixed privilege levels) Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This fixes the following: CMakeStyle File:cmake/gcc-m-cpu.cmake Line:7 Column:Remove space before '(' in if() statements CMakeStyle File:cmake/gcc-m-cpu.cmake Line:22 Column:Remove space before '(' in if() statements CMakeStyle File:cmake/gcc-m-cpu.cmake Line:28 Column:Remove space before '(' in if() statements CMakeStyle File:cmake/gcc-m-cpu.cmake Line:38 Column:Remove space before '(' in if() statements CMakeStyle File:cmake/gcc-m-cpu.cmake Line:48 Column:Remove space before '(' in if() statements Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Increase ARM64 stack sizes to accommodate deeper call stacks in userspace and SMP configurations when FPU_SHARING is enabled: - PRIVILEGED_STACK_SIZE: 1024 → 4096 bytes (with FPU_SHARING) - TEST_EXTRA_STACK_SIZE: 2048 → 4096 bytes (with FPU_SHARING) The default 1KB privileged stack is insufficient for ARM64 userspace syscalls when FPU context switching is enabled. Symptom: Userspace tests crash with Data Abort (EC 0x24) near stack boundaries during syscalls, particularly on SMP configurations where multiple threads exercise FPU lazy switching. Fixes previously failing CI test on fvp_base_revc_2xaem SMP variants: - kernel.threads.dynamic - Multiple userspace tests with FPU_SHARING enabled Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Memory protection and userspace tests require more MMU translation tables than the default. Without this increase, tests fail with: E: CONFIG_MAX_XLAT_TABLES too small ASSERTION FAIL [ret == 0] @ arch/arm64/core/mmu.c:1244 privatize_page_range() returned -12 Increase defaults when both USERSPACE and TEST are enabled: - 32 tables for SMP configurations (matching qemu_cortex_a53 SMP) - 24 tables for non-SMP configurations (matching qemu_cortex_a53) This fixes: - sample.kernel.memory_protection.shared_mem (all platforms) - rtio.api.userspace (v8a, v9a) - rtio.api.userspace.submit_sem (v8a, v9a) Consequently the demand paging test needed adjustment to its qemu_cortex_a53 configs to keep working as this test is highly sensitive to the amount of available free memory. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Use Inner Shareable (IS) TLB invalidation instructions in SMP configurations to broadcast TLB invalidations to all CPUs. Use TLBI VMALLE1IS instead of VMALLE1 in invalidate_tlb_all(). While at it, implement proper page-specific invalidation using TLBI VAE1IS in invalidate_tlb_page() instead of falling back to full invalidation. This fixes many SMP test failures with userspace enabled. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
The MPSC test consumer was incorrectly handling node returns to producer free queues. It called spsc_acquire() without checking the return value, then unconditionally called spsc_produce(). When the SPSC free queue was full, spsc_acquire() would return NULL and not increment the acquire counter, causing spsc_produce() to silently do nothing (it only produces if acquire > 0). This resulted in lost nodes. At least on QEMU, a 4-CPU configuration is needed for this bug to manifest. Producers put all nodes in flight simultaneously with the single consumer unable to keep up, causing frequent SPSC queue full conditions. The Fix: Loop on spsc_acquire() until it succeeds before calling spsc_produce(). This ensures nodes are always successfully returned to producer queues. Added board overlay for qemu_cortex_a53/smp to enable 4-CPU testing, which reproduces the issue and validates the fix. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
On ARM64 SMP systems, tight polling loops on atomic variables can fail to observe updates from other CPUs due to cache coherency issues, even when using atomic operations with acquire/release semantics. ARM64 atomic_get() compiles to LDAR (load-acquire), which provides memory ordering semantics but does NOT force cache coherency on every iteration in a tight loop. In the following pattern: while (atomic_get(&flag) == 0) { /* spin */ } The CPU can satisfy the LDAR from its local cache without running the cache coherency protocol, causing it to never see updates written by other CPUs. Acquire/release semantics provide ordering guarantees but not cache invalidation forcing. Add explicit DMB (Data Memory Barrier) before atomic loads in the lockfree library's SMP accessor macros: - mpsc_ptr_get(): Add barrier_dmem_fence_full() before atomic_ptr_get() - z_spsc_in(): Add barrier before atomic_get() - z_spsc_out(): Add barrier before atomic_get() The DMB forces completion of the cache coherency protocol, ensuring pending cache invalidations from other CPUs are processed before the atomic read, guaranteeing fresh data is observed. Zephyr's scheduler already uses this pattern in kernel/sched.c:149 where barrier_dmem_fence_full() is used with the comment: "Other cpus spin on this locklessly!" The lockfree test with 4 CPUs hung indefinitely on ARM FVP without these barriers but passes immediately with them. QEMU works without barriers due to simpler cache coherency simulation. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
|
This series modernizes ARM64 Fixed Virtual Platform (FVP) board support with
ARMv9-A enablement and unified board structure.
Changes:
names (fvp_base_revc_2xaem/{v8a,v9a,a320} with SMP variants)
Late additions for the full CI to pass: